<template>
  <div class="login">
    <div class="box">
      <!--      <img class="tou-time" src="../assets/img/touTime.png" alt="">-->
      <div class="tou-time"></div>
      <p>欢 迎 登 录 保 障 房 平 台</p>
      <div class="passWordBox">
        <p>密码登录</p>
        <van-field v-model="value" placeholder="请输入手机号" />
        <van-field
          v-model="passWord"
          type="password"
          placeholder="请输入密码"
        />
        <van-field v-model="yanzhengma" placeholder="请输入验证码" />
        <span class="input">p 1 6 5</span>
        <van-checkbox v-model="checked" shape="square"
          >我已阅读并同意<a href="#">《保障房隐私政策》</a></van-checkbox
        >
        <van-button type="info" @click="next()">登 录 </van-button>
        <div class="passWord">
          <span>忘记密码</span>
          <p>还没有账号？<a href="#">立即注册</a></p>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { Field, Button, Checkbox, Toast } from "vant";

export default {
  data() {
    return {
      checked: true,
      value: "",
      passWord: "",
      yanzhengma: "",
    };
  },
  name: "login",
  components: {
    [Field.name]: Field,
    [Button.name]: Button,
    [Checkbox.name]: Checkbox,
    [Toast.name]: Toast,
  },
  methods: {
    next() {
      if (!this.value) {
        this.$toast("请输入手机号");
        return;
      }
      if (!this.passWord) {
        this.$toast("请输入密码");
        return;
      }
      if (!this.yanzhengma) {
        this.$toast("请输入验证码");
        return;
      }
      if (!this.checked) {
        this.$toast("请勾选《保障房隐私政策》");
        return;
      }
      this.$router.push("/home");
    },
  },
};
</script>
<style scoped>
/** {*/
/*  margin: 0;*/
/*  padding: 0;*/
/*}*/
p {
  margin: 0;
  padding: 0;
}
a {
  color: #187ff5;
}
.login {
}
.box {
  background-image: url(../assets/img/beiJing.png);
  width: 3.75rem;
}
.tou-time {
  width: 100%;
  height: 0.44rem;
}
.box > p {
  font-size: 0.22rem;
  color: #ffffff;
  margin-left: 0.2rem;
}
.passWordBox {
  width: 100%;
  background-color: #ffffff;
  border-radius: 0.16rem 0.16rem 0 0;
  margin-top: 0.61rem;
  position: relative;
}
.passWordBox > p {
  font-size: 0.2rem;
  padding-top: 0.45rem;
  margin-left: 0.25rem;
}
.van-field {
  width: 3.27rem;
  height: 0.35rem;
  margin-top: 0.27rem;
  /*padding: .1rem .16rem;*/
}
.van-checkbox {
  margin-left: 0.24rem;
  font-size: 0.12rem;
  margin-top: 0.15rem;
}
.van-checkbox > a {
  font-size: 0.12rem;
}
.van-button {
  width: 3.26rem;
  height: 0.48rem;
  border-radius: 0.3rem;
  margin-top: 0.3rem;
  margin-left: 0.25rem;
  font-size: 0.16rem;
}
.passWord > span {
  float: right;
  font-size: 0.15rem;
  margin-top: -0.65rem;
  margin-right: 0.32rem;
}
.passWord > p {
  font-size: 0.15rem;
  margin-left: 1.12rem;
  margin-top: 0.82rem;
}
.input {
  position: absolute;
  font-size: 0.12rem;
  width: 0.6rem;
  height: 0.22rem;
  border: 1px solid #9a9a9a;
  color: #9a9a9a;
  right: 0.5rem;
  margin-top: -0.3rem;
  text-align: center;
  line-height: 0.22rem;
  border-radius: 0.05rem;
}
</style>
